import request from '@/utils/request'

// 查询波动率下拉
export function getVlsCodeList(query) {
  return request({
    url: '/pricing/comboBox/queryVolsurface.action',
    method: 'get',
    params: query
  })
}

// 查询波动率曲面定义
export function getVolsurfaceList(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/queryVolatilityCurveByPage.action',
    method: 'get',
    params: query
  })
}
// 修改波动率曲面定义
export function updateVolsurface(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/updateVlsCurve.action',
    method: 'post',
    data: query
  })
}
// 新增波动率曲面定义
export function addVolsurface(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/saveVlsCurve.action',
    method: 'post',
    data: query
  })
}
// 删除波动率曲面定义
export function delVolsurface(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/deleteVlsCurve.action',
    method: 'post',
    data: query
  })
}
// 查询历史波动里图标数据
export function getVlsChartData(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/queryVolSurfaceRates.action',
    method: 'get',
    params: query
  })
}
// 查询实时波动率数据
export function getRealTimeVlsChartData(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/queryRealTimeVolSurfaceRates.action',
    method: 'get',
    params: query
  })
}

// 查询实时波动率数据
export function getLastDateByVlsCode(query) {
  return request({
    url: '/marketdata/volatilityCurveStrip/getLastDateByVlsCode.action',
    method: 'get',
    params: query
  })
}

//新增波动率数据
export function addTvolsurfaceRatesDTO(form) {
  return request({
    url: '/marketdata/volatilityCurveStrip/addTvolsurfaceRatesDTO.action',
    method: 'post',
    data: form
  })
}

//修改波动率数据
export function updateTvolsurfaceRatesDTO(form) {
  return request({
    url: '/marketdata/volatilityCurveStrip/updateTvolsurfaceRatesDTO.action',
    method: 'post',
    data: form
  })
}


//查询当前登录用户的有权限的部门下的权限情况
export function listAllocateUser(query){
  return request({
    url: '/system/user/listVolSurfaceAllocateUser',
    method: 'get',
    params: query
  })
}

//授权
export function updateUserAuthority(params) {
  return request({
    url: '/marketdata/volatilityCurveStrip/updateSurfaceAuthority.action',
    method: 'post',
    data: params
  })
}